<!DOCTYPE html>
<html>
<head>
    <meta name="layout" content="main"/>
    <g:set var="entityName" value="${message(code: 'abnormalMortgageBatch.label', default: 'AbnormalMortgageBatch')}"/>
    <title>资产包待办</title>
    <style>
    .table>tbody>tr>td{
        vertical-align: middle;
    }
    @media screen and (min-width:1900px) and (max-width:1920px) {
        .flex{
            display: flex;justify-content: center;align-items: center;
        }
    }
    .select2-container .select2-choices .select2-search-field input,.select2-container .select2-choice,.select2-container .select2-choices{

        color: #999;
    }
    </style>
</head>

<body class="fixed-navbar fixed-sidebar">

<div class="small-header">
    <div class="hpanel">
        <div class="panel-body">
            <div id="hbreadcrumb" class="pull-right navFloatRight">
                <ol class="hbreadcrumb breadcrumb">
                     <li><span>CINDATA PLS</span></li>
                    <li class="active">
                        <span>资产包待办</span>
                    </li>
                </ol>
            </div>
        </div>
    </div>
</div>

<div class="content animate-panel">
    <div class="row">
        <g:form method="POST" action="pendingIndex" class="form-horizontal" role="form" id="form">
            <div class="hpanel hblue">
                <div class="panel-heading">
                    <div class="panel-tools">
                        <button class="btn btn-primary btn-xs" type="submit" onclick="text()"><i class="fa fa-search"></i> 查询</button>
                        <button class="btn btn-warning2 btn-xs" type="button" id="resetBtn">
                            <i class="fa fa-times"></i> 重置</button>
                    </div>
                    查询
                </div>

                <div class="panel-body seach-group" id="bug1">

                <div class="row">
                    <div class="form-group col-sm-4">
                        <label class="col-sm-3 control-label">名称</label>
                        <div class="col-sm-9">
                            <input type="text" class="form-control" name="name" id="name" value="${params?.name}" placeholder="请输入名称">
                            <input type="hidden" class="form-control" name="flag" id="flag" value="${params?.flag}" placeholder="请输入名称">
                        </div>
                    </div>
                    <div class="form-group col-sm-4">
                        <label class="col-sm-3 control-label">处置方式</label>
                        <div class="col-sm-9">
                            <g:select class="form-control" name="disposeMethod" id="disposeMethod" from="${com.cindata.AbnormalMortgageBatch.constrainedProperties.disposeMethod.inList}" noSelection="${['': '请选择处置方式']}" value="${params?.disposeMethod}" />
                        </div>
                    </div>
                </div>
            </div>
        </g:form>
    </div>
    </div>

    <div class="row">
        <div class="hpanel hgreen">

             <div class="panel-heading">
                <div class="panel-tools">
                    <a class="showhide"><i class="fa fa-chevron-up"></i></a>
                </div>
                全部资产包待办
            </div>

            <div class="panel-body no-padding">
                <div class="table-responsive">
                    <table cellpadding="1" cellspacing="1" class="table table-striped table-bordered table-hover text-center">
                        <thead>
                        <tr>
                            <g:sortableColumn property="name" title="名称" class="col-md-1 text-center" params="${params}"/>
                            <g:sortableColumn property="disposeMethod" title="处置方式" class="col-md-1 text-center" params="${params}"/>
                            <g:sortableColumn property="workflow" title="工作流" class="col-md-1 text-center" params="${params}"/>
                            <g:sortableColumn property="stage" title="当前阶段" class="col-md-1 text-center" params="${params}"/>
                            <g:sortableColumn property="status" title="状态" class="col-md-1 text-center" params="${params}"/>
                            <g:sortableColumn property="createdDate" title="创建时间" class="col-md-1 text-center" params="${params}"/>
                            <g:sortableColumn property="modifiedDate" title="修改时间" class="col-md-1 text-center" params="${params}"/>
                            <!-- <g:sortableColumn property="disposalDepartment" title="处置部门"  class="col-md-1 text-center" params="${params}"/> -->
                            <!-- <g:sortableColumn property="user" title="处置负责人"  class="col-md-1 text-center" params="${params}"/> -->
                            <!-- <g:sortableColumn property="description" title="处置要求说明"  class="col-md-1 text-center" params="${params}"/> -->
                        </tr>
                        </thead>
                        <tbody>
                        <g:each in="${workflowInstanceList}">
                            <tr>
                                <!-- <td><g:link controller="batchMortgage" action="index" style="color: #3498DB" class="firstTd" params="[batchId: it?.id]">${it?.name}</g:link></td> -->
                                <td><g:link action="pendingShow" style="color: #3498DB" class="firstTd" id="${it?.id}">${it?.abnormalMortgageBatch?.name}</g:link></td>
                                <td>${it?.abnormalMortgageBatch?.disposeMethod}</td>
                                <td>${it?.workflow?.name}</td>
                                <td>${it?.stage?.name}</td>
                                <td>
                                    <g:if test="${it?.status?.name == 'Pending'}">
                                        进行中
                                    </g:if>
                                    <g:if test="${it?.status?.name == 'Failed'}">
                                        失败
                                    </g:if>
                                    <g:if test="${it?.status?.name == 'Completed'}">
                                        已完成
                                    </g:if>
                                </td>
                                <td><g:formatDate date="${it?.createdDate}" format="yyyy-MM-dd HH:mm:ss"></g:formatDate></td>
                                <td><g:formatDate date="${it?.modifiedDate}" format="yyyy-MM-dd HH:mm:ss"></g:formatDate></td>
                                <!-- <td>${it?.abnormalMortgageBatch?.disposalDepartment}</td> -->
                                <!-- <td>${it?.abnormalMortgageBatch?.disposalUser?.fullName}</td> -->
                                <!-- <td>${it?.abnormalMortgageBatch?.description}</td> -->

                            </tr>
                        </g:each>
                        </tbody>
                    </table>
                </div>
            </div>

            <div class="panel-footer">
                <div class="pagination">
                    <g:paginate action="pendingIndex" total="${workflowInstanceCount ?: 0}" params="${params}"/>
                </div>
            </div>
        </div>
    </div>
</div>

<g:javascript>

    //重置按钮
    $("#resetBtn").click(function () {
        $("#name").val("");
        $("#s2id_disposeMethod span:first").html("请选择处置方式");
        $("#disposeMethod").val("");
    });
</g:javascript>

</body>
</html>
